//package com.mobile_fault_detector.controller.session;
//
//
//import com.mobile_fault_detector.common.ExceptionConstants;
//import com.mobile_fault_detector.dto.AIResponse;
//import com.mobile_fault_detector.dto.QueryRequest;
//import com.mobile_fault_detector.service.IGetAnswerService;
//import com.mobile_fault_detector.utils.Result;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//@Slf4j
//@RestController
//@RequestMapping("/session2")
//public class GetAnswerController {
//
//    private final IGetAnswerService IGetAnswerService;
//
//    @Autowired
//    public GetAnswerController(IGetAnswerService IGetAnswerService) {
//        this.IGetAnswerService = IGetAnswerService;
//    }
//
//    /**
//     * 获取AI意图
//     *
//     * @param queryRequest 用户问题请求
//     * @return AI回答响应
//     */
//    @PostMapping("/getAnswer")
//    public Result getAnswer(@RequestBody QueryRequest queryRequest) {
//        try {
//            log.info("收到用户问题: {}", queryRequest.getQuery());
//            AIResponse response = IGetAnswerService.getAnswer(queryRequest);
//            return Result.ok(response.getAnswer());
//        } catch (Exception e) {
//            log.error("getAnswer Exception", e);
//            AIResponse errorResponse = new AIResponse();
//            errorResponse.setAnswer(ExceptionConstants.SYSTEM_ERROR);
//            return Result.fail(errorResponse.getAnswer());
//        }
//    }
//}
